package org.celery.modules.other.wrapper;

import org.celery.modules.other.enums.PixelStatusEnum;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.celery.modules.other.entity.Pixel;
import org.celery.modules.other.vo.PixelVO;

/**
 * 像素表包装类,返回视图层所需的字段
 *
 * @author Celery
 * @since 2022-04-15
 */
public class PixelWrapper extends BaseEntityWrapper<Pixel, PixelVO>  {

    public static PixelWrapper build() {
        return new PixelWrapper();
    }

	@Override
	public PixelVO entityVO(Pixel pixel) {
		PixelVO pixelVO = BeanUtil.copy(pixel, PixelVO.class);
		pixelVO.setStatusName(PixelStatusEnum.getName(pixel.getStatus()));

		return pixelVO;
	}

}
